import java.sql.Connection
import java.sql.DriverManager
import java.sql.SQLException

object LocalDatabase {
    private const val URL =
        "jdbc:mysql://127.0.0.1:3306/hantang?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8"
    private const val USER = "Yanhe"
    private const val PASSWORD = "Yanhe0711"
    val connection: Connection? = try {
        Class.forName("com.mysql.cj.jdbc.Driver")
        DriverManager.getConnection(URL, USER, PASSWORD)
    } catch (e: SQLException) {
        System.err.println("【异常】SQLException\n")
        e.printStackTrace(System.err)
        null
    }

}